<template>
  <div class="box">
    <h1>组件间通信1: props</h1>
    <p>
      count: {{count}}
      <button @click="count++">更新自己的数据</button>
    </p>
    
    <Child title='来自于父组件的count' :count="count" :increment="increment"/>
  </div>
</template>

<script>
import Child from './Child.vue'
export default {
  name: 'PropsTest',
  components: {
    Child
  },
  data () {
    return {
      count: 0
    }
  },

  methods: {
    increment (num) {
      this.count += num
    }
  }
}
</script>

<style scoped>

</style>
